<template>
	<view class="box">
		<uNavbar title="设置" bgColor="transparent"></uNavbar>
		<view class="main">
			<view class="main_item" data-url="/pagesMy/setting/accountinformation" @click="allJump">
				<view class="main_item_left" >
					<image src="../../static/icon/set1.png" mode=""></image>
					<text>账号信息</text>
				</view>
				<uni-icons type="right" color="#fff" style="margin-right: 52rpx;" size="22"></uni-icons>
			</view>
			<view class="main_item" data-url="/pagesMy/setting/clause" @click="allJump">
				<view class="main_item_left">
					<image src="../../static/icon/set2.png" mode=""></image>
					<text>使用条款</text>
				</view>
				<uni-icons type="right" color="#fff" style="margin-right: 52rpx;" size="22"></uni-icons>
			</view>
			<view class="main_item" data-url="/pagesMy/setting/privacyrule" @click="allJump" >
				<view class="main_item_left">
					<image src="../../static/icon/set3.png" mode=""></image>
					<text>隐私协议</text>
				</view>
				<uni-icons type="right" color="#fff" style="margin-right: 52rpx;" size="22"></uni-icons>
			</view>
			<view class="main_item" data-url="/pagesMy/setting/punishescases" @click="allJump">
				<view class="main_item_left">
					<image src="../../static/icon/set4.png" mode=""></image>
					<text>违规处罚</text>
				</view>
				<uni-icons type="right" color="#fff" style="margin-right: 52rpx;" size="22"></uni-icons>
			</view>
			<view class="main_item" data-url="/pagesMy/setting/accountsecurity" @click="allJump">
				<view class="main_item_left">
					<image src="../../static/icon/set5.png" mode=""></image>
					<text>账户安全</text>
				</view>
				<uni-icons type="right" color="#fff" style="margin-right: 52rpx;" size="22"></uni-icons>
			</view>
			<view class="main_item" data-url="/pagesMy/setting/aboutus" @click="allJump">
				<view class="main_item_left">
					<image src="../../static/icon/set6.png" mode=""></image>
					<text>关于我们</text>
				</view>
				<uni-icons type="right" color="#fff" style="margin-right: 52rpx;" size="22"></uni-icons>
			</view>
			<view class="main_item" data-url="/pagesMy/setting/myservice" @click="allJump" >
				<view class="main_item_left">
					<image src="../../static/icon/set7.png" mode=""></image>
					<text>我的客服</text>
				</view>
				<uni-icons type="right" color="#fff" style="margin-right: 52rpx;" size="22"></uni-icons>
			</view>
		</view>
		<view class="btn flex_c" @click="out">
			<image class="highlights" src="../../static/image/mask.png" mode=""></image>
			<text>退出登录</text>
		</view>
	</view>
</template>
<script>
	import {logout} from "../../api/setting.js"
	export default {
		data() {
			return {
			
			}
		},
		methods: {
			allJump(e){
				console.log(e);
				let {url} = e.currentTarget.dataset;
				uni.navigateTo({
					url:url
				})
			},
			out(){
				logout().then(res=>{
					uni.$u.toast(res.msg);
					if(res.code==1){
						uni.removeStorageSync("token")
						uni.removeStorageSync("AmAwareOfIt")
						uni.removeStorageSync("realName")
						uni.removeStorageSync("ewmimg")
						uni.removeStorageSync("sharebg")
						uni.removeStorageSync("ewmimg")
						uni.removeStorageSync("isPay")
						// uni.clearStorageSync() //清除所有缓存
						setTimeout(()=>{
							uni.navigateTo({
								url:"/pages/login/login"
							})
						},1500)
						
					}
					
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		width: 750rpx;
		height: 1624rpx;
		background-color: #211E38;
	}
	.main{
		width: 750rpx;
		height:800rpx;
		margin-top: 20rpx;
		.main_item{
			margin-top: 20rpx;
			width: 750rpx;
			height: 100rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.main_item_left{
				display: flex;
				align-items: center;
				>image{
					width: 40rpx;
					height: 40rpx;
					margin-left: 48rpx;
				}
				>text{
					font-weight: 400;
					font-size: 32rpx;
					color: #FFFFFF;
					margin-left: 20rpx;
					
				}
			}
		}
	}
	.btn{
		position: relative;
		width: 92%;
		margin: 150rpx auto 0;
	}
	
	.btn>text {
		text-align: center;
		width: 100%;
		background: linear-gradient(274deg, #0014FF 0%, #8020EF 50%, #FF2CDF 100%) !important;
		color: #ffffff;
		font-size: 32rpx;
		padding: 20rpx 0;
		border-radius: 40rpx;
	}
</style>